package org.example.judge.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.api.model.dto.JudgeSubmitDTO;
import org.example.api.model.vo.UserQuestionResultVO;
import org.example.common.core.controller.BaseController;
import org.example.common.core.model.Result;
import org.example.judge.service.IJudgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : [Pashm]
 * @version : [v1.0]
 */

@RestController
@RequestMapping("/judge")
@Slf4j
public class JudgeController extends BaseController {

    @Autowired
    private IJudgeService judgeService;

    @PostMapping("/doJudgeJavaCode")
    public Result<UserQuestionResultVO> doJudgeJavaCode(@RequestBody JudgeSubmitDTO judgeSubmitDTO) {
        return Result.ok(judgeService.doJudgeJavaCode(judgeSubmitDTO));
    }
}
